import { _decorator, Component, find, instantiate, Node, Prefab } from 'cc';
import { UIBase } from '../FrameWork/UIFramework/UIBase';
import { ResMgr } from '../FrameWork/Res/ResMgr';
const { ccclass, property } = _decorator;

@ccclass('Menu')
export class Menu extends UIBase {

    onInit(...rest: any[]): void {
        this.addClickEventListener("_Normal", () => {
            //打开mainUI
            this.openUI("MainUI", true, true);
            //实例level1节点
            let Level1Pre = ResMgr.instance.getRes<Prefab>("Game", "Level1");
            let Level1Node = instantiate(Level1Pre);
            Level1Node.parent = find("Canvas");
        });
    }
}